From 1f59f5b4dab0343087c0e0730598dd2e9af042b0 Mon Sep 17 00:00:00 2001 From: Andreas Beckmann Date: Mon, 29 Nov 2021 22:25:10 +0100 Subject: [PATCH] [PATCH 105/144] hsa: check for clang -target hsail64 Gbp-Pq: Name 0105-hsa-check-for-clang-target-hsail64.patch --- cmake/HSA.cmake | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/cmake/HSA.cmake b/cmake/HSA.cmake index 08eb3ac..4381461 100644 --- a/cmake/HSA.cmake +++ b/cmake/HSA.cmake @@ -32,7 +32,16 @@ else() if(RESULT) message(FATAL_ERROR "LLVM support for amdgcn--amdhsa target is required") endif() - set(HSAIL_ENABLED 1) + # test that Clang supports the hsail64 target + message(CHECK_START "Check if Clang accepts -target hsail64") + custom_try_compile_clangxx("" "return 0;" RESULT "-target" "hsail64" "-emit-llvm" "-S") + if(RESULT) + message(CHECK_FAIL "no") + set(HSAIL_ENABLED 0) + else() + message(CHECK_PASS "yes") + set(HSAIL_ENABLED 1) + endif() endif() if (NOT DEFINED AMD_HSA) -- 2.30.2